package com.repository;

import com.entity.SysHistoryAndPackageVersion;
import com.entity.SysServerAndPackageVersion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author Yadasu
 * @date 2021/1/26 9:59
 */
public interface SysServerAndPackageVersionRepository extends JpaRepository<SysServerAndPackageVersion,Integer> {
    @Query(value = "SELECT * FROM `sys_server_package_version` WHERE deploy_id=?1",nativeQuery = true)
    SysServerAndPackageVersion findByDeployIdInServer(Integer id);
    @Query(value = "SELECT * FROM `sys_server_package_version` WHERE server_id=?1",nativeQuery = true)
    SysServerAndPackageVersion findByServerIdIdInServer(Integer id);
}
